package com.huawei;

import java.util.Scanner;

public class HJ001 {
    public static int getLastWordLength(String sentence){
        String[] wordArr = sentence.split(" ");
        String lastWord = wordArr[wordArr.length-1];
        return lastWord.length();
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()){
            String sentence = scanner.nextLine();
            System.out.println(sentence);
            int lastWordLength = getLastWordLength(sentence);
            System.out.println(lastWordLength);
        }
    }
}
